package cn.wolfcode.wms.qo;

import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Calendar;
import java.util.Date;

@Setter
@Getter
public class BaseAuditQueryObject extends QueryObject {
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    private Integer status = -1;

    public void setEndDate(Date date) {
        if (date == null) {
            return;
        }
        Calendar caledar = Calendar.getInstance();
        caledar.setTime(date);
        caledar.set(Calendar.HOUR_OF_DAY, 23);
        caledar.set(Calendar.MINUTE, 59);
        caledar.set(Calendar.SECOND, 59);
        this.endDate = caledar.getTime();
    }
}
